<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <!-- 
    Copyright 2009 Google Inc.
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.  
  -->
	<head>
		<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
	  <title>{{ site_title }}</title> 
    <script src="http://www.google.com/jsapi"></script>
    <script type="text/javascript">
      google.load("jquery", "1.3.1");
      google.load('friendconnect', '0.8', { 
        {% if friendconnect.base_domain %}'base_domain':'{{ friendconnect.base_domain }}'{% endif %}
      });
      google.load("search", "1");
    </script>
    <script type="text/javascript">
      function setMessage(text) {
        $("#message").text(text).removeClass("hidden");
      };
    
      function init(times) { };
      
      function onFriendConnectInitialized(st) {
        if (!window.friendconnect_times_loaded) {
          window.friendconnect_times_loaded = 1;
        } else {
          window.friendconnect_times_loaded++;
        }
        init(window.friendconnect_times_loaded);
      };
          
      function onAjaxLoaded() {
        google.friendconnect.container.setParentUrl('{{ friendconnect.parent_url }}');
        google.friendconnect.container.loadOpenSocialApi({
          site: '{{ friendconnect.site_id }}',
          onload: onFriendConnectInitialized
        });

        
      };
      
      google.setOnLoadCallback(onAjaxLoaded);
    </script>
    <style type="text/css">
      @import url("/static/base.css");
      @import url("/static/skin.css");
    </style>	  
    <!--[if lte IE 7]> 
      <style type="text/css">
        @import url("/static/ie.css"); 
      </style>
    <![endif]-->

    {% block head %}
	  {% endblock head %}
	</head>
  <body>
    <div id="wrap" class="{{ view }} largebottomrounded">
      <div id="topbar" class="">
        <div id="controls">
          {% if viewer %}
            <img src="{{ viewer.thumbnail_url }}" class="thumbnailurl" />
            Hi {{ viewer.display_name }} 
            {% ifequal viewer.user_type "friendconnectuser" %}
              | <a href="javascript:void(0);" onclick="google.friendconnect.requestSettings();">Settings</a> 
              | <a href="javascript:void(0);" onclick="google.friendconnect.requestInvite();">Invite friends</a>
              | <a href="members.html">Members</a>
            {% endifequal %}
            {% ifequal viewer.user_type "loggedout_friendconnectuser" %}
              | <span id="login-loggedoutuser"></span>
              <script type="text/javascript">                
                google.friendconnect.renderSignInButton({
                  "id" : "login-loggedoutuser",
                  "text" : "Log in with Friend Connect",
                  "style" : "text"
                });
              </script>
            {% endifequal %}
            | <a href="/logout">Sign out</a>
          {% else %}
            Hi Guest!
            {% ifnotequal view "login" %}<a href="/login">Sign In</a>{% endifnotequal %}
          {% endif %}
        </div>
        <h1 class="logo"><a href="/">The <strong>Chow Down</strong></a></h1>
      </div>
      <div id="content">
        {% if messages %}
          <div id="message" class="smallrounded">{{ messages|join:"<br />" }}</div>
        {% else %}
          <div id="message" class="hidden smallrounded"></div>
        {% endif %}
        
        {% block body %}
        {% endblock body %}
      </div>
    </div>
    <div id="bottombar">
      This site uses Creative Commons licensed images from 
      <a href="http://www.flickr.com/photos/grendelkhan/121671781/sizes/l/">grendelkhan</a>,
      <a href="http://flickr.com/photos/shiznotty/3337509004/sizes/o/">shiznotty</a>,
      <a href="http://flickr.com/photos/gaetanlee/755481598/sizes/l/">gaetanlee</a>, 
      <a href="http://www.flickr.com/photos/derusha/561781801/sizes/l/">derusha</a>,
      and <a href="http://www.famfamfam.com/lab/icons/silk/">the Silk icon set</a>.
      
      {% block footer %}
      {% endblock %}
    </div>
<script type="text/javascript">
  var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
  document.write(unescape("%3Cscript src='" +
    gaJsHost +
    "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>

<script type="text/javascript">
  try {
    var pageTracker = _gat._getTracker("{{ analytics_id }}");
    {% if viewer %}
      pageTracker._setVar("{{ viewer.user_type }}"); 
    {% endif %}
      pageTracker._trackPageview();
    } catch(err) {}    
</script>
  </body>
</html>